home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 September
/
EnigmA AMIGA RUN 30 (1998)(G.R. Edizioni)(IT)[!][issue 1998-09].iso
/
recent
/
yam2usnt.lha
/
usenet.install.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-07-16
|
7KB
|
136 lines
/* -----------------------------------------------------
YAM2Usenet v0.5 installation file : 16-Jul-98
©1998 Ridwan Hughes <yam2usenet@ridhughz.demon.co.uk>
http://www.ridhughz.demon.co.uk/yam2usenet/
----------------------------------------------------- */
if ~exists('libs:rexxreqtools.library') then do
if exists('libs/rexxreqtools.library') then address command 'copy libs/rexxreqtools.library libs:'
else do
address command 'run <>nil: c:requestchoice "YAM2Usenet v0.5 © 1998 Ridwan Hughes" "ERROR: cannot find rexxreqtools.library*NPlease make sure it exists in libs:*Nif it didn''t come with this archive*Nthen download it from Aminet:*NRexxReqTools.lha util/rexx 65K 1.3 - requester for ARexx" OK'
exit 0
end
end
if ~show('L','rexxreqtools.library') then addlib('rexxreqtools.library',0,-30,0)
datestamp=date('s')||compress(time(),':')
/* start of checking that TCP: exists */
/* */
address command 'assign >t:assignlist';o=open(as,'t:assignlist')
tcp=0;rl=readln(as);do while rl~='Devices:';rl=readln(as);end
do while ~eof(as)
if words(rl)>0 then do;do i=1 to words(rl);if word(rl,i)='TCP' then tcp=1;end;end
rl=readln(as)
end
close(as)
if tcp=0 then quitmsg('ERROR:*NPlease start your TCP/IP stack.')
/* */
/* end of checking that TCP: exists */
address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "This is a script I wrote to connect to a newsserver and download*Nusenet articles then parse them into YAM2 to be read.*N*NThe usage of these scripts assumes you know how to use YAM2*Ncompetently enough to create folders+filters for the*Nnewsgroup(s) you download from.*N*NIf you want to continue then click on OK*N*NYAM2Usenet v0.5 ©1998 Ridwan Hughes <yam2usenet@ridhughz.demon.co.uk>" "OK, install it" "Update scripts to v0.5" "Quit installation" >pipe:out'
o=open(inn,'pipe:out','r');rl=readln(inn);close(inn);if rl=0 then exit 0
address command 'copy <>nil: usenet.post.rexx YAM:'
address command 'copy <>nil: usenet.read.rexx YAM:'
address command 'copy <>nil: usenet.doc YAM:'
if rl=2 then do;address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes"
"YAM2Usenet ©1998 Ridwan Hughes is now updated to v0.5*N<yam2usenet@ridhughz.demon.co.uk>" OK >nil:';exit 0;end
address command 'copy <>nil: usenet.post.rexx.info YAM:'
address command 'copy <>nil: usenet.read.rexx.info YAM:'
address command 'copy <>nil: usenet.doc.info YAM:'
nserver=rtgetstring('','Enter news server name (blank to quit installation)'d2c(10)'usually it''s news.your.isp like news.demon.co.uk,'d2c(10)'but not all newsservers are public ones.'d2c(10)||d2c(10)'Some public access newsservers are as follows: server (groups carried):'d2c(10)'209.75.104.10 (25000), 195.204.199.88 (22600), 206.28.168.22 (28000)'d2c(10)'news.edu.sollentuna.se (23000), news-reader.wcg.net (60000),'d2c(10)'news.okidata.com (24000), pub.news.uk.psi.net (18500), news.uov.net (21000)'d2c(10)'news.spar.ca (18500), 209.125.132.138 (29000), 209.60.156.214 (23500)'d2c(10)'194.78.80.195 (34000), news.ausmail.com (??), sion1.bathspa.ac.uk (28000)','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
if nserver='' | rtresult=0 then exit 0
address command 'echo >yam:usenet.server "'nserver'"'
ngroup=rtgetstring('','Enter the first newsgroup to join (blank to quit installation)','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
if ngroup='' | rtresult=0 then exit 0
ngdisp=ngroup
ng=ngroup
address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Join more newsgroups? current newsgroups are:*N*N'ngdisp'" "Add more newsgroups" "Finished adding newsgroups" >pipe:out'
o=open(inn,'pipe:out','r');stoppit=1-readln(inn);close(inn)
do while stoppit=0
n=rtgetstring('','Enter in another newsgroup to join:','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
if n='' then stoppit=1
else do
ng=ng||d2c(10)||n
ngdisp=ngdisp||'*N'||n
address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Join more newsgroups? current newsgroups are:*N*N'ngdisp'" "Add more newsgroups" "Finished adding newsgroups" >pipe:out'
o=open(inn,'pipe:out','r');stoppit=1-readln(inn);close(inn)
end
end
if open(f,'yam:usenet.groups','w') then do;writeln(f,ng);close(f);end
else quitmsg('ERROR:*NThe file [usenet.groups] cannot be accessed for some reason,*Nanother program probably has it open.')
/* datestamp datestamp datestamp datestamp datestamp datestamp datestamp */
ds='-'||left(datestamp,4)
ds='-'right(left(datestamp,6),2)||ds
ds=right(left(datestamp,8),2)||ds' '
ds=ds||right(left(datestamp,10),2)
ds=ds||':'||right(left(datestamp,12),2)
ds=ds||':'||right(datestamp,2)
address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "The current datestamp 'ds' will be set,*Nunless you either use the datestamp from the newsserver,*Nor you enter in your own datestamp to get backlogged articles?*N(you must be online to take the newsserver datestamp)" "Current date" "Newsserver date" "Set own date" >pipe:out'
o=open(inn,'pipe:out','r');rl=readln(inn);close(inn)
if rl=0 then do
nd=rtgetstring(datestamp,'Enter in new datestamp, current is '||ds||d2c(10)'which you must enter it in like: 'datestamp||d2c(10)'YYYYMMDDHHMMSS - year month day hour(24hour) minute second','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
if nd='' | rtresult=0 then nd=datestamp
datestamp=nd
end
if rl=2 then do
if open(newz,'tcp:'nserver'/119','a') then do
null=readln(newz)
writeln(newz,'DATE')
datestamp=left(word(readln(newz),2),14)
close(newz)
end
end
address command 'echo >yam:usenet.datestamp "'datestamp'"'
address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Do you want to add any entries into the killfile?" Yes No >pipe:out'
o=open(inn,'pipe:out','r');rl=readln(inn);close(inn)
kill=''
if rl=1 then do
killdisp=''
stoppit=0
do while stoppit=0
k=rtgetstring('','Enter in a new killfile line, articles are killfiled'||d2c(10)'by their Message-ID: lines, for example if you'd2c(10)'have the ID <qRdezgAqqUl1EaAl@some.spam.net> then you'd2c(10)'enter in @some.spam.net> to kill posts from there.','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
if k='' then stoppit=1
else do
kill=kill||k||d2c(10)
killdisp=killdisp||k||'*N'
address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Stop adding entries into the killfile? current entries are:*N*N'left(killdisp,length(killdisp)-2)'" "Add more kill lines" "Stop adding" >pipe:out'
o=open(inn,'pipe:out','r');stoppit=1-readln(inn);close(inn)
end
end
end
if length(kill)>0 then kill=left(kill,length(kill)-1)
if open(f,'yam:usenet.killfile','w') then do;writeln(f,kill);close(f);end
else quitmsg('ERROR:*NThe file [usenet.killfile] cannot be accessed for some reason,*Nanother program probably has it open.')
quitmsg('YAM2Usenet v0.5 ©1998 Ridwan Hughes <yam2usenet@ridhughz.demon.co.uk>*Nis now installed into your YAM: drawer.*NAll you need to do now is to read the usenet.doc file, run YAM2,*Nset up the appropriate filters+folders and then click on the*Nusenet.read.rexx icon in your YAM2 drawer to
download news*Narticles from your favourite newsgroup(s).*N*NEnjoy...')
exit 0
/* ************************************* */
quitmsg: procedure
parse arg why
address command 'run <>nil: c:requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "'why'" OK'
exit 0
return